

import yaml

import yagmail

import logging

from datetime import datetime
#日志文件时间
datatime=datetime.now().strftime('%Y%m%d %H%M%S')
log=(f'{datatime}.log')
#封装日志方法
def log1():
    logging.basicConfig(filename=log,filemode='w+',level=logging.DEBUG,format='%(levelname)s ->%(asctime)s ->%(message)s')


#封装邮箱
def sed_mail(filep):
    sed1=yagmail.SMTP(user='1006142636@qq.com',password='hygnwdryluhsbgac',host='smtp.qq.com')
    sed1.send(to='1006142636@qq.com',subject='酒仙业务',contents='今日报告,请查看',attachments=filep)
#封装yaml文件
def yam(filep):
    with open(filep,'r',encoding='utf-8')as e:
        return yaml.safe_load(e)

